<html>
	<head>
		<meta charset="tuf8">
		<style>
		body{ padding:0; margin:0; background:#eee;}
		img.img,.file{ position:absolute; top:0; left:0; width:100%; height:100%;}
		.file{ z-index:888; opacity:0;}
		</style>
	</head>
	<body>
	<form method="post" name="fileForm" id="fileForm" enctype="multipart/form-data">
		<input type="file" name="file" onchange="uplaod()" class="file"/>
		<empty name="url">
			<img src="__PUBLIC__/images/upload.jpg" class="img" />
		<else/>
			<img src="{$url}" class="img" />
		</empty>
	</form>
	<script>
	function uplaod(){
		fileForm.submit();
	}
	<notempty name="errmsg">
	alert('{$errmsg}');
	</notempty>
	<if condition="!empty($_GET['index'])">
	<notempty name="url">
	parent.{$_GET['event']}('{$_GET["index"]}','{$url}');
	</notempty>
	<else/>
	<notempty name="url">
	parent.{$_GET['event']}('{$url}');
	</notempty>
	</if>
	</script>
	</body>
</html>